<!doctype html>
<html lang="en" ng-app="Estate">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" type="image/x-icon" href="/assets/bitbug_favicon-7.ico" />
    <title>
        <g:layoutTitle default="Some Title" />
    </title>
    <asset:stylesheet src="homer/vendor/bootstrap/dist/css/bootstrap-datepicker3.min.css" />
    <asset:stylesheet src="homer/vendor/fontawesome/css/font-awesome.min.css" />
    <asset:stylesheet src="homer/fonts/pe-icon-7-stroke/css/helper.css" />
    <asset:stylesheet src="homer/fonts/pe-icon-7-stroke/css/pe-icon-7-stroke.css" />
    <asset:stylesheet src="homer/vendor/ladda/dist/ladda-themeless.min.css" />
    <asset:stylesheet src="ztree/demo.css"/>
    <asset:stylesheet src="ztree/zTreeStyle.css/"/>
    <asset:stylesheet src="homer/vendor/animate/animate.css" />
    <asset:stylesheet src="homer/vendor/metisMenu/metisMenu.min.css" />
    <asset:stylesheet src="homer/vendor/bootstrap/dist/css/bootstrap.min.css" />
    <asset:stylesheet src="homer/vendor/bootstrap/dist/css/bootstrap-datepicker3.min.css" />
    <asset:stylesheet src="homer/vendor/toastr/toastr.min.css"/>
    <asset:stylesheet src="homer/style.css" />
    <asset:stylesheet src="homer/vendor/sweetalert/lib/sweet-alert.css" />
    <asset:stylesheet src="homer/vendor/select2-3.5.2/select2.min.css" />
    <asset:stylesheet src="homer/vendor/select2-3.5.2/select2-bootstrap.css" />
    <asset:stylesheet src="homer/vendor/datetimepicker/bootstrap-datetimepicker.min.css" />
    <asset:stylesheet src="homer/vendor/footable/footable.core.min.css" />

    <asset:stylesheet src="styles/css/index.css"/>
    <asset:stylesheet src="styles/css/account.css" />
    <asset:stylesheet src="styles/css/common.css" />

    <asset:javascript src="homer/vendor/jquery/dist/jquery.min.js" />
    <asset:javascript src="homer/vendor/index.js"/>
    <asset:javascript src="angular/angular.min.js" />
    <asset:javascript src="angular/tree/angular-ui-tree.min.js" />
    <asset:javascript src="angular/ui/ui-bootstrap-tpls-2.5.0.min.js" />
    <asset:javascript src="common/moment-with-locales.js" />
    <asset:javascript src="layouts/layouts.js" />

    <script language="JavaScript">
        window.app = angular.module("Estate", ['ui.tree','ui.bootstrap']);
    </script>

<g:layoutHead/>

<style type="text/css">
.dropdown-menu{
    left: -10px;
}
</style>

</head>

<body class="fixed-navbar fixed-sidebar fixed-footer">
<div class="splash">
    <div class="color-line"></div>

    <div class="splash-title">
        <h1>PLS</h1>

        <div class="spinner">
            <div class="rect1"></div>

            <div class="rect2"></div>

            <div class="rect3"></div>

            <div class="rect4"></div>

            <div class="rect5"></div>
        </div>
    </div>
</div>
<!-- Navigation -->
<nav class="navbar navbar-default navbar-fixed-top nodisplay" style="height: 56px">
    <div class="row" style="position: absolute;left: 7px;">
        <div class="navLeftFontSize">
            <a href="/main/welcome">
                <g:if test="${com.cindata.User.findById(session.SPRING_SECURITY_CONTEXT.authentication.principal.id)?.isGD()}">
                    <asset:image src="gd_logo.png" class=""/>
                </g:if>
                <g:elseif test="${com.cindata.User.findById(session.SPRING_SECURITY_CONTEXT.authentication.principal.id)?.isYC()}">
                    <asset:image src="yc_logo.png" class=""/>
                </g:elseif>
                <g:else>
                    <asset:image src="pls_logo1.png" class=""/>
                </g:else>
            </a>
        </div>
    </div>
    %{--手机端出现导航菜单--}%
    <div class="header-link hide-menu"><i class="fa fa-bars"></i></div>

    <div class="navbar-right navBack" id="header-right">
        <ul class="nav navbar-nav no-borders">
            <li class="dropdown" style="display: flex;align-items: center;">
                <i class="fa fa-user-circle fa-2x" aria-hidden="true"></i>
            </li>
            <li id="loginName">
                <a class="page-scroll" href="#">${com.cindata.User.findById(session.SPRING_SECURITY_CONTEXT.authentication.principal.id)?.fullName}</a>
                <ul class="nav nav-second-level loginSelect" id="loginNameSel">
                    <li>
                        <a class="page-scroll" href="#" data-toggle="modal" data-target="#myModal8">修改密码</a>
                    </li>
                    <li>
                        <g:link controller="logoff" style="font-size: 14px">退出</g:link>
                    </li>
                </ul>
            </li>
        </ul>
    </div>
</nav>

%{--修改密码--}%
<div class="modal fade hmodal-info in" id="myModal8" tabindex="-1" role="dialog" aria-hidden="true" style="display: none; padding-right: 17px;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="color-line"></div>
            <div class="modal-body" style="height: 200px;">
                <div class="form-group" style=" margin-bottom: 10%"><label class="col-sm-2 control-label" >原密码</label>

                    <div class="col-sm-10"><input type="password" class="form-control newPsd" name="password"></div>
                </div>
                <div class="form-group" style="margin-bottom: 20%"><label class="col-sm-2 control-label" >新密码</label>

                    <div class="col-sm-10"><input type="password" class="form-control newPsd" name="password"></div>
                </div>
                <div class="form-group" ><label class="col-sm-2 control-label" >新密码</label>

                    <div class="col-sm-10"><input type="password" class="form-control newPsd" name="password"></div>
                </div>
                <p style="margin-left: 66px; color: red;" id="loginTS"></p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" id="changePsd">确定更改</button>
            </div>
        </div>
    </div>
</div>
</body>

<aside id="menu">
    <div id="navigation">
        <div class="profile-picture">
            <asset:image src="indexHeader.jpg" class="img-circle m-b" alt="" />
            <div class="stats-label text-color">
                
                <div class="dropdown">
                    <a class="dropdown-toggle" href="#" data-toggle="dropdown">
                        <!-- <small class="text-muted">${com.cindata.MortgageCategory.findById(session?.categoryId)?.name}<b class="caret"></b></small> -->
                        <span class="font-extra-bold font-uppercase">${com.cindata.MortgageCategory.findById(session?.categoryId)?.name}<b class="caret"></b></span>
                    </a>
                    <ul class="dropdown-menu animated flipInX m-t-xs">
                        <%categoryList=com.cindata.User.findById(session.SPRING_SECURITY_CONTEXT.authentication.principal.id)?.getCategoryArr()%>
                        <g:each in="${categoryList}" var='pit'>
                            <li style="margin-left: 10px;font-size: 14px;font-weight: bold;">${pit?.category?.name}</li>
                            <li class="divider"></li>
                            <%categoryItemsList=com.cindata.User.findById(session.SPRING_SECURITY_CONTEXT.authentication.principal.id)?.getCategoryItemsArr(pit.category.id)%>
                            <g:each in="${categoryItemsList}" var='cit'>
                                <li><a href="${cit?.url}?categoryId=${cit?.id}">${cit?.name}</a></li>
                            </g:each>
                            <li class="divider"></li>
                        </g:each>
                    </ul>
                </div>

                <div id="sparkline1" class="small-chart m-t-sm"></div>
                <!-- <div>
                    <h4 class="font-extra-bold m-b-xs">
                        $260 104,200
                    </h4>
                    <small class="text-muted">Your income from the last year in sales product X.</small>
                </div> -->
            </div>
        </div>
        
        <ul class="nav" id="side-menu">
            <%menuList=com.cindata.User.findById(session.SPRING_SECURITY_CONTEXT.authentication.principal.id)?.getMenuItemsArr(session?.categoryId?.toLong())%>
            <g:each in="${menuList?.findAll{it.parent==null}}" var ='pit'>
                <g:if test="${menuList?.findAll{it.parent==pit}.size()!=0}">
                    <li class="">
                        <a class="page-scroll" id="menu_${pit.id}" href="${pit.url}" activeUrl="${pit.activeUrl}"><i class="${pit.icon}"></i>
                        ${pit.title}<span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <g:each in="${menuList?.findAll{it.parent==pit}}" var="cit">
                                <li>
                                    <a id="menu_${cit.id}" href="${cit.url}?categoryId=${session?.categoryId}" parentid="menu_${pit.id}" activeUrl="${cit.activeUrl}">${cit.title}</a>
                                </li>
                            </g:each>
                        </ul>
                    </li>
                </g:if>
                <g:else>
                    <li>
                        <a id="menu_${pit.id}" class="page-scroll" href="${pit.url}?categoryId=${session?.categoryId}" activeUrl="${pit.activeUrl}"><i class="${pit.icon}" aria-hidden="true"></i>${pit.title}</a>
                    </li>
                </g:else>
            </g:each>
        </ul>
    </div>
</aside>

<div id="wrapper">
    <g:layoutBody/>
</div>

<footer class="footer" style="text-align: center;">
    <g:if test="${com.cindata.User.findById(session.SPRING_SECURITY_CONTEXT.authentication.principal.id)?.isYC()}">
        2017${com.cindata.DateUtilService.showCurrentYear()} © 重庆中科云丛科技有限公司
    </g:if>
    <g:else>
        2017${com.cindata.DateUtilService.showCurrentYear()} © 北京国信达数据技术有限公司
    </g:else>
</footer>

<asset:stylesheet src="homer/vendor/fontawesome/css/font-awesome.min.css" />
<asset:stylesheet src="homer/fonts/pe-icon-7-stroke/css/helper.css" />
<asset:stylesheet src="homer/fonts/pe-icon-7-stroke/css/pe-icon-7-stroke.css" />
<asset:javascript src="homer/vendor/bootstrap/dist/js/bootstrap.min.js" />
<asset:javascript src="homer/vendor/datepicker/bootstrap-datepicker.min.js" />
<asset:javascript src="homer/vendor/datepicker/bootstrap-datepicker.zh-CN.min.js" />
<asset:javascript src="homer/vendor/datetimepicker/bootstrap-datetimepicker.min.js" />
<asset:javascript src="homer/vendor/metisMenu/metisMenu.min.js" />
<asset:javascript src="homer/vendor/sweetalert/lib/sweet-alert.min.js" />
<asset:javascript src="homer/vendor/toastr/toastr.min.js"/>
<asset:javascript src="homer/vendor/select2-3.5.2/select2.min.js" />
<asset:javascript src="homer/vendor/select2-3.5.2/select2_locale_zh-CN.js" />
<asset:javascript src="homer/vendor/iCheck/icheck.min.js" />
<asset:javascript src="homer/vendor/footable/footable.all.min.js" />
<asset:javascript src="homer/vendor/toastr/toastr.min.js"/>
<asset:javascript src="homer/homer.js" />
<asset:javascript src="common/common.js" />
<asset:javascript src="homer/vendor/ladda/dist/spin.min.js" />
<asset:javascript src="homer/vendor/ladda/dist/ladda.min.js" />
<asset:javascript src="homer/vendor/ladda/dist/ladda.jquery.min.js" />

<asset:stylesheet src="/homer/c3.css"/>
<asset:javascript src="/echarts/c3.min.js"/>
<asset:javascript src="/echarts/d3.min.js"/>
<asset:javascript src="/echarts/Chart.min.js"/>


%{--  <asset:javascript src="echarts/api?v=2.0&ak=ZUONbpqGBsYGXNIYHicvbAbM" />--}%

<asset:javascript src="echarts/echarts.js" />
<script>
    $(function() {


        // Initialize metsiMenu plugin to sidebar menu
        $('#side-menu').metisMenu();

        // Initialize iCheck plugin
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green'
        });
        //        折叠
        $(".collapsed .showhide").click(function() {
            $(this).parent().parent().toggleClass("hbuilt");
            $(this).parent().parent().parent().toggleClass("panel-collapse");
        });
        $("select").select2();
        $('.form_datetime').datetimepicker({
            minView: "day",
            //选择日期后，不会再跳转去选择时分秒
            format: "yyyy-mm-dd hh:00:00",
            //选择日期后，文本框显示的日期格式
            language: 'zh-CN',
            //汉化
            autoclose: true //选择日期后自动关闭
        });

        //删除数据
        $(document).delegate(".deleteBtn", "click",
            function() {
                var currentForm = $(this).parent("form");
                swal({
                        title: "您确认删除该数据吗?",
                        type: "warning",
                        showCancelButton: true,
                        confirmButtonColor: "#DD6B55",
                        cancelButtonText: "取消",
                        confirmButtonText: "删除",
                        closeOnConfirm: false,
                        closeOnCancel: true

                    },
                    function(isConfirm) {
                        if (isConfirm) {
                            currentForm.submit();

                        }
                    });

            });
        $('#citySelect').change(function() {
            var currentCity = $('#citySelect').val()
            //                alert(currentCity)
            // 写入session
            $.ajax({
                type: "POST",
                url: "/login/currentCity",
                data: {
                    city: currentCity
                },
                success: function(msg) {
                    if (window.location.pathname.indexOf('/estate/searchEstate') >= 0) {
                        location.replace("/estate/searchEstate")
                    }
                }
            })
            //如果是搜索页面 刷新页面

            //如果是主页
            //            if(window.location.pathname.indexOf('/main/index')>=0){
            //                initCloum(currentCity)
            ////                initMap(1,currentCity)
            //                initStatics(currentCity)
            //            }
        })

    });
    // 限制输入框数值大小
    function text(){
        if(loansAmountStart.value<0||loansAmountStart.value>214748||loansAmountEnd.value<0||loansAmountEnd.value>214748||loansBalanceEnd.value<0||loansBalanceEnd.value>214748
            ||loansBalanceStart.value<0||loansBalanceStart.value>214748||buildAreaStart.value<0||buildAreaStart.value>214748||buildAreaEnd.value<0||buildAreaEnd.value>214748){
            toastr.error('值应0-214748之间');
            loansAmountStart.value ='';
            loansAmountEnd.value='';
            loansBalanceStart.value='';
            loansBalanceEnd.value='';
            buildAreaStart.value='';
            buildAreaEnd.value='';
        }
    }
    // 限制输入框数值大小
    function text1(){
        if(loansAmountStart.value<0||loansAmountStart.value>214748||loansAmountEnd.value<0||loansAmountEnd.value>214748||loansBalanceEnd.value<0||loansBalanceEnd.value>214748
            ||loansBalanceStart.value<0||loansBalanceStart.value>214748){
            toastr.error('值应0-214748之间');
            loansAmountStart.value ='';
            loansAmountEnd.value='';
            loansBalanceStart.value='';
            loansBalanceEnd.value='';
        }
    }

    // 错误信息弹出框的参数配置
    toastr.options = {
        "closeButton": true,
        "debug": false,
        "newestOnTop": false,
        "progressBar": false,
        "positionClass": "toast-top-center",
        "preventDuplicates": false,
        "onclick": null,
        "showDuration": "300",
        "hideDuration": "1000",
        "timeOut": "3000",
        "extendedTimeOut": "1000",
        "showEasing": "swing",
        "hideEasing": "linear",
        "showMethod": "fadeIn",
        "hideMethod": "fadeOut"
    };

    $("#sparkline1").sparkline([5, 6, 7, 2, 0, 4, 2, 4, 5, 7, 2, 4, 12, 11, 4], {
       type: 'bar',
       barWidth: 7,
       height: '30px',
       barColor: '#62cb31',
       negBarColor: '#53ac2a'
    });
</script>
</body>
</html>